package com.nn.controller;

import com.nn.pojo.Report;
import com.nn.service.ReportService;
import com.nn.vo.SysResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("/report")
public class ReportController {
    @Autowired
    private ReportService reportService;

    /**
     * 查询统计数据
     * await this.$http.get("/report/getData")
     */
    @GetMapping("/getData")
    public SysResult getData() {
        List<Report> list = reportService.getData();
        return SysResult.success(list);
    }

}
